<!-- 盘点 列表 -->
<template>
	<view class="common_out">
		<view class="common_out_list" v-for="(item,index) in rundata">
			<!-- 盘存列表 -->
			<div class="common_left" v-if="som_type" @click="analysis_list(item)">
				<view class="common_list" >
					<view class="common_list_name">仓库:</view>
					<view class="common_list_neir" >{{item.warehouseName}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">盘点方式:</view>
					<view class="common_list_neir" >{{item.checkWay == '1' ? '全盘' : item.checkWay == '2' ? '抽盘' : ''}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">盘点单编号:</view>
					<view class="common_list_neir" >{{item.voucherCode}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">盘点人:</view>
					<view class="common_list_neir" >{{item.reviewerUserName}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">监盘人:</view>
					<view class="common_list_neir" >{{item.superviseUserName}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">状态:</view>
					<view class="common_list_neir" >{{item.voucherState == '1' ? '已复核' : item.voucherState == '2' ? '已监盘' : item.voucherState == '3' ? '已审批' :'未复核'}}</view>
				</view>
			</div>
			 <!-- 盘亏显示 -->
			<div class="common_left" v-if="somv_type" @click="analysis_list(item)">
				<view class="common_list" >
					<view class="common_list_name">仓库名称:</view>
					<view class="common_list_neir" >{{item.warehouseName}}</view>
				</view>
			
				<view class="common_list" >
					<view class="common_list_name">物料编码:</view>
					<view class="common_list_neir" >{{item.voucherCode}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">所属部门:</view>
					<view class="common_list_neir" >{{item.officeName}}</view>
				</view>
				<view class="common_list" >
					<view class="common_list_name">状态:</view>
					<view class="common_list_neir" >{{item.voucherState == '1' ? '已复核' : item.voucherState == '2' ? '已监盘' : item.voucherState == '3' ? '已审批' :'未复核'}}</view>
				</view>
			
				<view class="common_list" >
					<view class="common_list_name">盘点日期:</view>
					<view class="common_list_neir" >{{item.voucherDate}}</view>
				</view>
			</div>
		</view>
		<div class="null_title" v-if="rundata == ''">
			<div>	
				<i class="iconfont icon-empty iconcize"></i>		
			</div>
			<div class="null_title_tow">
				没有更多数据	
			</div>
		</div>
	</view>
</template>


<script>
	export default {
		props: {
			rundata: {
				default: Array
			},
			somvo:{
				default: Number
			},
			rulCode: {
				default: String
			}
		},
		data(){
			return {
				dataSorce: '',
				Url_str: '',
				somv_type: false,
				som_type: true,
			}
		},
		mounted() {
			if(this.somvo == 1){
				this.somv_type = true;
				this.som_type = false;
			}
			
			
		},
		methods: {
			analysis_list(val){
				uni.navigateTo({
					url: '/pages/common/index/purchase/library/inventory_details?id=' + val.id + '&tak=' + this.rulCode.tak + '&code=' + this.rulCode.code + '&msg=' + this.rulCode.msg + '&title=' + this.rulCode.title + '&somvo=' + this.somvo
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.common_out {
		width: 95%;
		margin: auto;
	}
	.common_out_list {
		padding: 10px 0 10px 30rpx;
		border-radius: 4px;
		margin-bottom: 10px;
		background-color: #fff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
		display: flex;
	}
	.common_list {
		display: flex;
		height: 40rpx;
		line-height: 40rpx;
	}
	.common_list_name {
		width: 25%;
		text-align: left;
		overflow: hidden;
		
		
	}
	.common_list_neir {
		padding: 0 0 0 20rpx;
		overflow: hidden;
	}
	.common_left {
		width: 100%;
	}
	
</style>
